package com.aotao.springboot.mapper;


import com.aotao.springboot.domain.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import javax.management.relation.Role;
import java.util.List;

@Mapper
@Repository
public interface ArticleMapper {
    public List<Article> getArticle();

    public int insertArticle(Article article);

    public int insertArticleTag(@Param("article") Article article, @Param("articleTag") ArticleTag tag);

    public ArticleTag queryTagByName(@Param("tagName") String tagName);

    public List<ArticleType> queryAllTypes();

    public Article queryArticleByID(int id);

    public int updateArticle(@Param("article") Article article);

    public int updateArticleTag(@Param("article") Article article, @Param("articleTag") ArticleTag tag);

    public int deleteArticleToTagByArticleID(int id);

    public List<ArticleTag> queryAllTags();

    public int insertTypes(@Param("articleType") ArticleType articleType);

    public int updateType(@Param("articleType") ArticleType articleType);

    public int deleteTypeByID(@Param("did") int did);

    public int updateArticleForType(@Param("did") int did);

}